<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>留言 - 会员中心 -{$sitename}</title>
{include file="center_include"/}
<script type="text/javascript">
var reloadcode = function(){
	$('#safecode').attr('src',"{:zanpian_user_url('user/validate/verify','',false,false)}-" + Math.random());}
		function setupLabel(){
            if($('.label-checkbox input').length) {
                $('.label-checkbox').each(function(){
                    $(this).removeClass('label-checkbox-on');
                });
                $('.label-checkbox input:checked').each(function(){
                    $(this).parent('label').addClass('label-checkbox-on');
                });
            };
            if($('.label-radio input').length) {
                $('.label-radio').each(function(){
                    $(this).removeClass('label-radio-on');
                });
                $('.label-radio input:checked').each(function(){
                    $(this).parent('label').addClass('label-radio-on');
                });
            };
        }  
		function initLabelEvent(){
			$(".user-img-list li").hover(function(){
				$(this).find(".ui-del").show();
			},function(){
				$(this).find(".ui-del").hide();
			});

			$('.label-checkbox').click(function(){
				setupLabel();
			});
			setupLabel();
		}
	</script>
</head>
<body>
{include file="center_header"/}
<!-- // i-header end -->
<div id="content" class="layout">
  <div class="ui-box ui-qire fn-clear" id="i-box">
    <div id="i-bar">
 {include file="center_nav"/} 
 {include file="center_fk"/}
    </div>
    <!-- // i-bar end -->
    <div class="i-box-cnt" id="i-cnt">
      <div id="i-subscribe">
        <div class="ui-title i-tab-nav-box fn-clear">
           <ul class="i-tab-nav" id="pids">
            <li class="current"><a href="{:zanpian_user_url('user/center/gb',array('op'=>1))}" hidefocus="">全部</a></li>
              {volist name="catalogs" id="catalog"}
            	<li class="line"></li>
            	<li><a href="{:zanpian_user_url('user/center/gb',array('op'=>1,'cid'=>$catalog['cid'],'p'=>1))}" hidefocus="">{$catalog.name}<span>{$catalog.count}</span></a></li>
              {/volist}
          </ul>
          <a class="i-button givegb boxopen cboxElement" href="#add-feedback">我要留言</a></div>
        <div class="ui-cnt">
          <form id="delcomm" method="post" onsubmit="return false;">
            <ul class="user-txt-list feedback-list fn-clear" id="xlist">
             <li class="loading"><img src="{$apicss}user/new/images/loading.gif"/>正在努力为您加载中... </li>
            </ul>
          </form>
          <!-- // i-list End -->
          <div class="user-opera fn-clear">
            <div class="check-del">
              <label class="label-checkbox" for="checkall" hidefocus="">
                <input type="checkbox" id="checkall" class="delcheckall"> 全选</label>
                  <form action="" method="post" id="delremindform">
                  <input type="hidden" value="" id="delids" name="lid">
                <a class="ui-edit ui-edit-short cleanup" href="javascript:;" data="{:zanpian_user_url('user/center/gb')}">删除</a>
              </form>
            </div>
             <div class="loading pagess"><ul class="pagination" id="xpage" style="float:right"></ul></div>
          </div>
          <!-- // i-do End -->
        </div>
      </div>
      <!-- // ui-box End -->
    </div>
    <!-- // i-cnt End -->
    <!-- bigbox-->
    <div style="display:none">
      <div id="add-feedback">
        <div class="ui-dialog-cnt">
          <div class="ui-dialog-width ui-gb-dialog">
            <form id="bform" method="post" onsubmit="return false;">
              <div class="ui-form">
                <div class="ui-form-title">
                  <h3>我要留言</h3>
                </div>
                <div class="ui-dialog-tab">
                  <ul id="gb_types">
                    {volist name="gbtype" id="type"}
                    <li val="{$key}" {eq name="key" value="0"}class="current"{/eq}>{$type}<span>&nbsp;</span></li>
                    {/volist}
                  </ul>
                  <input type="hidden" name="gb_cid" id="gb_type" value="1">
                  <script type="text/javascript">
								$("#gb_types li:first").addClass('current');
								$("#gb_type").val($("#gb_types li:first").attr('val'));
								$("#gb_types li").bind('click',function(e){									
									$("#gb_types li").each(function(){
										$(this).removeClass('current');

									});
									$(this).addClass('current');
									$("#gb_type").val($(this).attr('val'));
								});
				  </script>
                </div>
                <div class="ui-form-item fn-clear">
                  <input type="text" name="gb_title" id="title" class="ui-input w470" maxlength="30">
                </div>
                <div class="ui-form-item fn-clear">
                  <textarea id="txt" name="gb_content" class="ui-input ui-textarea w455" rows="5" cols="60"></textarea>
                </div>
               {notempty name="userconfig['user_code']"}  
               <div class="ui-form-item fn-clear">
              <label for="validate" class="ui-label w60">验证码：</label>
                 <input type="text" id="validate" name="validate" maxlength="5" class="ui-input w70" value="">&nbsp;<a href="javascript:reloadcode()"><img src="{:zp_url('user/validate/verify','',false,false)}" alt="看不清楚换一张" name="safecode" border="0" align="absbottom" id="safecode"></a></div>
                 {/notempty}
                <div class="ui-form-item fn-clear">
                  <input type="button" id="bigboxbt" class="ui-button w150" value="提 交">
                </div>
              </div>
              <!-- // ui-form End -->
            </form>
          </div>
          <!-- // ui-gb-dialog End -->
        </div>
      </div>
      <!-- // Dialog End -->
    </div>
    <!-- bigbox end-->
 <script type="text/javascript">		
   	   $(".boxopen").click(function(e){	
			$(this).colorbox({
				inline:true, 
				width: "542px"
			});
			$("#add-feedback #title").val('');
			$("#add-feedback #txt").val('');
			$("#add-feedback #bigboxbt").unbind();
			$("#add-feedback #bigboxbt").click(function(e){
				$("#add-feedback #bform").qiresub({
					curobj:$("#add-feedback #bigboxbt"),
					txt:'数据提交中,请稍后...',
					onsucc:function(result){
						if(parseInt(result.rcode)==1){
							//pagegoo(window.location.href+"-ajax");
							pagegoo("{:zanpian_user_url('user/center/gb')}");
							$.colorbox.close();
							$("#pids li:first").addClass('current');
							$("#pids li:gt(1)").removeClass('current');
						}
						$.hidediv(result);
					}
				}).post({
					url:"{:zanpian_user_url('user/center/addgb')}"
					});
			});
		});
		function pagegoo(url){
			$.ajax({ url: url,  
				success: function(data){
					if('' != data.ajaxtxt){
						$("#xlist").html(data.ajaxtxt);
						$("#xpage").html(data.pages);
						initLabelEvent();
						$("#xpage a").click(function (e){
							pagegoo(e.target);
							return false;
						});
						$(".mdel").click(function(){
							var parents=$(this).parents('li');
							$.showfloatdiv({
								wantclose:2,
								succdo:function(r){
									parents.remove();
								},txt:'确认删除?'
							});
						});
						$(".delcheckall").click(function(){
							checkAll('');
						});
				}else{
				   $("#xlist").html('<li class="kong">您暂时还没有提什么意见哦！有什么意见和建议告诉我们吧!</li>');
				   $(".i-do").hide();
				}
			},dataType:'json'});
			return false;				
		}
		pagegoo("{:zanpian_user_url('user/center/gb')}");
		$(".cleanup").click(function(e){
			$.showfloatdiv({
				wantclose:2,
				ispost:1,
				formid:'delcomm',
				url:"{:zanpian_user_url('user/center/delgb')}",
				succdo:function(r){
					if(parseInt(r.rcode)==1){
						pagegoo("{:zanpian_user_url('user/center/gb')}");	
					}
					
				},txt:'确认删除?'
			});
		});
		$("#pids a").click(function (e){
			$(this).parent('li').nextAll().removeClass('current');
			$(this).parent('li').prevAll().removeClass('current');
			$(this).parent('li').addClass('current');
			pagegoo($(this).attr('href'));
			return false;
		});

		$(".gb-list li").click(function (){
			$(this).find("h5 strong").removeClass('read');
		});
		</script>
  </div>
  <!-- // maxBox End -->
</div>
<!-- // wrap End -->
</div>
<!-- // footer end -->
{include file="footer"/}
</body>
</html>